<!-- 财务管理 -->
<template>
  <div style="padding: 0 32px;">
    <div style="display: flex;align-items: center;padding: 12px 0;">
      <div style="flex:1" ></div>
      <el-input v-model="searchText" placeholder="请输入内容" style="max-width: 220px;margin-right: 16px;" />
      <el-button type="primary" icon="el-icon-search" @click="onSearch">搜索</el-button>
    </div>
    <financial_manager_table :tableList="tableList" @refreshList="queryFinancialDataList"/>
    <pagination v-show="total>0" :total="total" :page.sync="pageParams.pageIndex" :limit.sync="pageParams.pageSize" @pagination="queryFinancialDataList" />
  </div>
</template>

<script>
import financial_manager_table from './table.vue';
import Pagination from '@/components/Pagination';
import { queryFinancialList } from '@/api/platFinanceStatement';

export default {
  components: {
    financial_manager_table,
    pagination: Pagination
  },
  data() {
    return {
      activeName: 'first',
      name: '我要下单',
      searchText: '',
      pageParams: {
        pageIndex: 0, pageSize: 10
      },
      tableList: [],
      total: 0
    }
  },
  mounted() {
    this.queryFinancialDataList();
  },
  methods: {
    async queryFinancialDataList() {
      const { data } = await queryFinancialList({ ...this.pageParams, queryBean: { seachText: this.seachText } });
      if (data.code === 200) {
        this.tableList = data.data.records || [];
        this.total = data.data.total;
      } else {
        this.$message({
          message: data.msg || '列表获取失败',
          type: 'error',
          showClose: true,
          duration: 3000,
        });
      }
    },
    onSearch() {
      this.queryFinancialDataList();
    }
  }
}
</script>

<style>
.deleteBorder .el-tabs__nav-wrap::after{
    height: 0;
  }
  .pagination-container {
    float: right;
  }
</style>
